
// <copyright file="DynamicIntelligentCopyHelperTests.cs" company="Subhadra Software Solutions">
//   
// </copyright>
// <summary>
//   Class DynamicIntelligentCopyHelperTests.
// </summary>

namespace SubhadraSolutions.Sharp.Utils.Tests.Reflection
{
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    using SubhadraSolutions.Sharp.Utils.Reflection;
    using SubhadraSolutions.Sharp.Utils.Tests.DummyClasses;
    using SubhadraSolutions.Sharp.Utils.Xml.Serialization;

    /// <summary>
    ///     Class DynamicIntelligentCopyHelperTests.
    /// </summary>
    [TestClass]
    public class DynamicIntelligentCopyHelperTests
    {
        #region Public Methods and Operators

        /// <summary>
        ///     Tests this instance.
        /// </summary>
        [TestMethod]
        public void Test()
        {
            Department1 d1 = Department1.BuildDummyDepartment1();
            var d2 = new Department2();
            DynamicIntelligentCopyHelper<Department1, Department2>.Copy(d1, d2);
            string d1Xml = XmlSerializationHelper.Serialize(d1);
            string d2Xml = XmlSerializationHelper.Serialize(d2);
            d2Xml = d2Xml.Replace("Department2", "Department1");
            d2Xml = d2Xml.Replace("Employee2", "Employee1");
            Assert.IsTrue(d1Xml == d2Xml);
        }

        #endregion Public Methods and Operators
    }
}
